﻿using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp;
using Volo.Abp.Modularity;

namespace Bangle.Abp.SameSiteCookies
{
    public class SameSiteCookiesModule : AbpModule
    {
        public override void ConfigureServices(ServiceConfigurationContext context)
        {
            //解决https问题
            context.Services.ConfigureNonBreakingSameSiteCookies();
        }

        public override void OnApplicationInitialization(ApplicationInitializationContext context)
        {
            var app = context.GetApplicationBuilder();

            //解决https问题
            app.UseCookiePolicy();
        }
    }
}
